package game.controler.ecouteurs.splashscreen;

import game.controler.Action;
import game.gui.panelinventaire.PanelInventaire;
import game.model.splashscreen.SplashScreen;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

/**
 *
 * @author Gab'z
 */
public class EcouteurSplashScreen implements MouseListener {

    private String idSplashScreenSuivant;

    public EcouteurSplashScreen(SplashScreen splashScreen) {
        this.idSplashScreenSuivant = splashScreen.getIdSuivant();
    }

    @Override
    public void mouseClicked(MouseEvent e) {
        //throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void mousePressed(MouseEvent e) {
        // throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void mouseReleased(MouseEvent e) {
        System.out.print("Ecouteur splashScreen idSplashScreenSuivant = ");
        if (idSplashScreenSuivant != null && !"".equals(idSplashScreenSuivant)) {
            System.out.println(idSplashScreenSuivant);
            Action.removeSplashScreen();
            Action.afficherSplashScreen(idSplashScreenSuivant);
        } else {
            System.out.println("null ou \"\"");
            PanelInventaire.reloadPanelInventaire();
        }
        Action.removeSplashScreen();
    }

    @Override
    public void mouseEntered(MouseEvent e) {
        // throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public void mouseExited(MouseEvent e) {
        // throw new UnsupportedOperationException("Not supported yet.");
    }
}
